package comun;

public class PeliculaVistaNoSi implements ValorId_p, valorId_u {
	/**
	 * tabla--> tablaPeliculaVistaNoSi
	 * 
	 * id_u,id_p,vista
	 */

	private int id_u, id_p;
	private boolean vista;

	public PeliculaVistaNoSi() {

		this.id_u = 0;
		this.id_p = 0;
		this.vista = false;
	}

	public PeliculaVistaNoSi(int id_u, int id_p, boolean vista) {

		this.id_u = id_u;
		this.id_p = id_p;
		this.vista = vista;
	}

	@Override
	public int getId_u() {
		return id_u;
	}

	@Override
	public void setId_u(int id_u) {
		this.id_u = id_u;
	}

	@Override
	public int getId_p() {
		return id_p;
	}

	@Override
	public void setId_p(int id_p) {
		this.id_p = id_p;
	}

	public boolean isVista() {
		return vista;
	}

	public void setVista(boolean vista) {
		this.vista = vista;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id_p;
		result = prime * result + id_u;
		return result;
	}

	@Override
	public boolean equals(Object obj) {

		boolean dev = false;

		PeliculaVistaNoSi pvns = (PeliculaVistaNoSi) obj;
		if (pvns.getId_u() == this.getId_u()) {
			if (pvns.getId_p() == this.getId_p()) {
				dev = true;
			}
		}
		return dev;
	}
}
